<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="{{__PUBLIC__}}/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="{{__PUBLIC__}}/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="{{__PUBLIC__}}/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="{{__PUBLIC__}}/Admin/Flat/img/favicon.ico">

	    <script src="{{__PUBLIC__}}/Home/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>

	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	</head>
	<body>
		<form action="" method="post">
			<table class="table table-hover"  style="border:1px solid #DDDDDD;">
				<tr class="active">
				  <th width="100">分类ID</th>
				  <th  width="200">分类名称</th>
				  <th  width="200">所属类型</th>
				 <th>排序</th>
		
				  <th width="250">操作</th>
				</tr>

				<!-- 控制子集显隐 -->
				<script type="text/javascript">
					$(function(){
						$('.open').toggle(function(){
							var cid = $(this).attr('cid');
							$('tr[pid=' + cid + ']').fadeIn(600);
						}, function(){
							var cid = $(this).attr('cid');
							$('tr[pid=' + cid + ']').fadeOut(600);
						});
					});
				</script>
				
				{{foreach from="$cateData" key="$k" value="$v"}}
				<tr  pid="{{$v['pid']}}" {{if value="$v['pid']!=0"}} style="display:none;" {{endif}}>
					<td>{{$v['cid']}}</td>
					<td  class='open' cid="{{$v['cid']}}">{{$v['_name']}}</td>
					<td>{{$v['type_tid']}}</td>
					<td>
						<div class="col-sm-10">
							<input style="height:35px;" type="text" name="{{$v['cid']}}" id="inputEmail3" class="form-control" value="{{$v['sort']}}">
						</div>
					</td>
					<td>
						<a href="{{U('Category/addson',array('cid'=>$v['cid']))}}" class="btn btn-sm btn-primary">添加子类</a>
						<a href="{{U('Category/edit',array('cid'=>$v['cid']))}}" class="btn btn-sm btn-warning">编辑</a>
						<a href="javascript:if(confirm('确定删除吗？')) location.href='{{U('Category/del',array('cid'=>$v['cid']))}}';" class="btn btn-sm btn-danger">删除</a>
					</td>
				</tr>
				{{endforeach}}
			</table>
			<button type="submit" class="btn btn-sm btn-warning" style="background:#006ECC;">排序</button type="submit">
		</form>
	</body>
</html>
